import { defineStore } from "pinia";

export const useAlertsStore = defineStore("home", {
  state: () => {
    return {
      centerDialogVisible: false,
      UserInfo:JSON.parse(localStorage.getItem('userInfo')) || {}
    }
  },
  actions: {
    checkDialog(a) {
      this.centerDialogVisible = a;
      console.log(this.centerDialogVisible, "999");
    },
    UserRegister(UserReg) {
      this.User = UserReg
    },
    saveUserInfo(User){
      this.UserInfo = User
      localStorage.setItem('userInfo',JSON.stringify(User))
    },
    logoutLogin(){
      this.UserInfo = {}
      localStorage.removeItem('userInfo')
    }
  },
});
